package com.mf.entity.req.basic.webPage;

import java.io.Serial;

import com.mf.emuns.enumsPublic.EnumPublicEnableOrDisable;
import com.mf.groups.GroupsUpdateInterface;
import com.mf.groups.GroupsAddInterface;
import com.mf.valid.ValidEnumValue;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Null;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * 权限表提交
 */
@Data
public class ReqWebMenu implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    @NotNull(message = "id不能为空", groups = {GroupsUpdateInterface.class})
    @Null(message = "新增id必须为空", groups = {GroupsAddInterface.class})
    private Integer id;

    @Schema(description = "路由菜单访问路径")
    @NotBlank(message = "路由菜单访问路径不能为空", groups = {GroupsAddInterface.class, GroupsUpdateInterface.class})
    private String path;
    @Schema(description = "路由 name (对应页面组件 name, 可用作 KeepAlive 缓存标识 && 按钮权限筛选)")
    @NotBlank(message = "路由名称", groups = {GroupsAddInterface.class, GroupsUpdateInterface.class})
    private String pathName;

    @Schema(description = "路由标题 (用作 document.title || 菜单的名称)")
    @NotBlank(message = "路由标题不能为空", groups = {GroupsAddInterface.class, GroupsUpdateInterface.class})
    private String metaTitle;

    @Schema(description = "视图文件路径")
    private String componentPath;
    @Schema(description = "路由重定向地址")
    private String redirect;
    @Schema(description = "权限码List<String>")
    private List<String> metaRole;
    @Schema(description = "菜单和面包屑对应的图标")
    private String metaIcon;

    @Schema(description = "排序")
    private Integer sort;
    @Schema(description = "父级id")
    private Integer pid;
    @Schema(description = " 当前路由为详情页时，需要高亮的菜单")
    private String metaActiveMenu;
    @Schema(description = "路由外链时填写的访问地址")
    private String metaIsLink;
    @Schema(description = "是否在菜单中隐藏 (通常列表详情页需要隐藏)")
    private Integer metaIsHide;
    @Schema(description = "菜单是否全屏 (示例：数据大屏页面)")
    private Integer metaIsFull;
    @Schema(description = "菜单是否固定在标签页中 (首页通常是固定项)")
    private Integer metaIsAffix;
    @Schema(description = "权限描述")
    private String remark;

    @Schema(description = "1启用，0禁用")
    @ValidEnumValue(enumClass = EnumPublicEnableOrDisable.class, message = "状态值错误")
    private Integer status;
    @Schema(description = "当前路由是否缓存")
    private Integer metaIsKeepAlive;
    @Schema(description = "其他标识,通常类似功能使用同一页面是用于区分")
    private String metaFlag;
}
